﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class PrintEmploymentForm : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //Dim doc As New System.Xml.XPath.XPathDocument(New System.IO.StringReader(xml))
        //Dim xslt As New System.Xml.Xsl.XslCompiledTransform()
        //xslt.Load(Request.MapPath("~/css/SRMPrintStyleSheet.xslt"))
        //Dim sw As New System.IO.StringWriter()
        //xslt.Transform(doc, Nothing, sw)

        //
        // Load DataSet as Xml, XPathDocument //GetXMLDetailsForPrint(CType(strApplicantKey, Integer), CType(strAppReqKey, Integer))
        // appkey=12907&appreqkey=201
        string xml = SRM.DataObjects.SRM_Form.GetApplicationFormXml(Request["appkey"], Request["appreqkey"]);
        System.Xml.XPath.XPathDocument xmlPathDoc = new System.Xml.XPath.XPathDocument(new System.IO.StringReader(xml));

        System.Xml.Xsl.XslCompiledTransform xslt = new System.Xml.Xsl.XslCompiledTransform(true);
        xslt.Load(Request.MapPath("~/Content/EmploymentForm.xslt"));

        // 
        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        System.IO.StringWriter sw = new System.IO.StringWriter(sb);
        xslt.Transform(xmlPathDoc, null, sw);


        //Response.Write(xml);
        Response.Write(sw.ToString());
    }
}